


export default function TopTable(props) {
    const info=props.info||{};
    const {unit,isEnd,classification,isLogin,isSupp,status,bid}=info;
    const {deptName,userName,itemNo,itemName,brand,count,itemPropertyGroupCode,information,coreTechnologyRequirement,otherTechnologyRequirement,fileUrl,fileName,specifications}=info.item||{}

    const isShowCore=(classification==4||classification==113)&&itemPropertyGroupCode=="SEQUENCING"

    return(
        <div className={'zen_m-t-20 bid-info-table'}>
            <div className={'zen_flex'}>
                <span className={'bid-info-row-name'}>需求发布人</span>
                {
                    unit=="中山大学"? <span className={'bid-info-row-val'}>{'-'}</span>:
                        <div className={'bid-info-row-val'}>
                            <span>{deptName}</span>
                            <span className={'zen_m-l-15'}>{userName}</span>
                        </div>
                }
            </div>

            <div className={'zen_flex'}>
                <span className={'bid-info-row-name'}>商品名称</span>
                <span className={'bid-info-row-val'}>{itemName}</span>
            </div>
            <div className={'zen_flex'}>
                <span className={'bid-info-row-name'}>商品规格</span>
                <span className={'bid-info-row-val'}>{specifications||'暂无'}</span>
            </div>

            <div className={'zen_flex'}>
                <span className={'bid-info-row-name'}>品牌要求</span>
                <span className={'bid-info-row-val'}>{brand||'暂无'}</span>
            </div>

            <div className={'zen_flex'}>
                <span className={'bid-info-row-name'}>货号要求</span>
                <span className={'bid-info-row-val'}>{itemNo||'暂无'}</span>
            </div>

            <div className={'zen_flex'}>
                <span className={'bid-info-row-name'}>采购数量</span>
                <span className={'bid-info-row-val'}>{count}</span>
            </div>
            <div className={'zen_flex'}>
                <span className={'bid-info-row-name'}>商品单位</span>
                <span className={'bid-info-row-val'}>{info&&info.item&&info.item.unit||'暂无'}</span>
            </div>
            {
                isShowCore&& (
                    <div className={'zen_flex'}>
                        <span className={'bid-info-row-name'}>核心技术要求</span>
                        <span className={'bid-info-row-val'}>{coreTechnologyRequirement||'暂无'}</span>
                    </div>
                )
            }
            {
                isShowCore&& (
                    <div className={'zen_flex'}>
                        <span className={'bid-info-row-name'}>其他技术要求</span>
                        <span className={'bid-info-row-val'}>{otherTechnologyRequirement||'暂无'}</span>
                    </div>
                )
            }
            {
                !isShowCore&&(
                    <div className={'zen_flex'}>
                        <span className={'bid-info-row-name'}>采购要求</span>
                        <span className={'bid-info-row-val'}>{information||'暂无'}</span>
                    </div>
                )
            }

            <div className={'zen_flex'}>
                <span className={'bid-info-row-name'}>要求文件</span>
                {
                    fileUrl?
                        <div className={'bid-info-row-download'}>
                                   <span
                                       onClick={()=>{
                                           window.open(`/bid${fileUrl}`)
                                       }}
                                   >{`${fileName}`}</span>
                        </div>
                        :
                        <span className={'bid-info-row-val'}>{'暂无'}</span>
                }

            </div>
        </div>
    )
}